<!--edit page create by pionner at Tue Nov 25 15:11:25 CST 2008-->
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib uri="ttp://www.security.com/tag" prefix="sc"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script language="javascript">
	function IsEmpty()
{
var userName=document.addform.userName.value;
var userPwd=document.addform.userPwd.value;
var birthday=document.addform.birthday.value;
if(userName==0||userPwd==0||birthday==0){
alert("请填写完整内容！");
return;
}

document.addform.submit();
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<base href="<%=basePath%>">
		<title>Userlist</title>
		<link rel="stylesheet" href="css/style.css">
		<link rel='stylesheet' type='text/css' href='css/table.css'>
		<link rel='stylesheet' type='text/css' href='css/style.css'>
		<link href="template/css.css" rel="stylesheet" type="text/css">
		<link rel="stylesheet" type="text/css" media="all" href="<%=path%>/js/calendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
    
		<script type="text/javascript" src="<%=path%>/js/calendar/calendar.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-setup.js"></script>
	<script type="text/javascript" src="<%=path%>/js/calendar/calendar-zh1.js"></script> 
		<script src='js/comm.js'></script>
	</head>
	<body>
		<table width="200" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="90"><img src="images/loc-head.jpg" width="90" height="24"></td>
				<td valign="middle" nowrap background="images/loc-bg.jpg">用户新增</td>
				<td width="12"><img src="images/loc-tail.jpg" width="12" height="24"></td>
			</tr>
		</table><br>		
		<s:form name="addform"  action="userlistSave.action">
			<table width='100%' border='0' cellspacing='1' class="ipttable">
				<s:hidden name="fromTree" label="部门"/>
				<s:textfield cssClass="input130" name='userName' label='用户名'/>
				<s:textfield cssClass="input130" name='cname' label='中文姓名'/>
				<s:textfield cssClass="input130" name='birthday' id='birthday' label='生日（例：1980-01-01）' readonly="true"/>
				<s:textfield cssClass="input130" name='userId' label='身份证'/>
				<s:password cssClass="input130" name='userPwd' label='密码' size="22"/>				
				<s:textfield cssClass="input130" name='telphone' label='手机号码'/>				
				<s:hidden id="departmentId" name='departmentId'/>
				<s:textfield cssClass="input130" onclick="openform()" id="departmentName" name='departmentName' label='部门'/>
				<s:textfield cssClass="input230" name='address' label='地址'/>
				<s:textfield cssClass="input130"name='carNo' label='车牌号'/>
			</table>
			<table width='50%' border='0' cellspacing='0' >
			<tr>
			<td align="center">
			<input type="button" value="提交" onClick="javascript:IsEmpty()" class="submitbtn">
			<input type="reset" value="重置" class="resetbtn">
			<input type="button" value="返回" onClick="javascript:history.back(-1)" class="backbtn">
			</td>
			</tr>
			</table>
		</s:form>
	</body>
</html>

<script type="text/javascript">
    	function openform(){
    		var title = ""; 
		var url = '../deptSel.jsp';
		var pageUrl="../deptSel.jsp";
		var paraObj = new Object();
		paraObj.url=url;
		paraObj.title=title;
		paraObj.rootId='-2';
		var objId=document.getElementById("departmentId");
		var objName=document.getElementById("departmentName");
		paraObj.input=objId;
		var sFeatures = 'help:no;status:1;dialogHeight:500px;dialogWidth:350px;center:1';
	    var rtnObj= window.showModalDialog(pageUrl,paraObj,sFeatures );
	    //alert('rtnObj='+rtnObj);
		if(rtnObj){
			var result=rtnObj.result;
			objId.value=result.id;
			objName.value=result.name;
		}else{
    		
    	}
    	//alert('openform');
    	}
    	
 
    	
    	Calendar.setup(
		    {
		      inputField  : 'birthday',         // ID of the input field
		      ifFormat    : "%Y-%m-%d",    // the date format
		      onSelect   : onSelect,
		      showsTime : false
		    }
		  );
		 
function onSelect(calendar, date) {
    
    	var curEdt = document.getElementById(calendar.params.inputField.id);
      	curEdt.value = date;
      
    
	};	 
  
    </script>

